Skip to content

fix: persist CNAME for identus.io custom domain - #273

Merged
patextreme merged 1 commit into
mainfrom
fix/durable-cname
Jul 31, 2026
Merged

fix: persist CNAME for identus.io custom domain#273
patextreme merged 1 commit into
mainfrom
fix/durable-cname

Conversation

@patextreme

Copy link
Copy Markdown
Contributor

Problem

The docs site (https://identus.io/) has been repeatedly breaking: the page goes unstyled and shows Docusaurus' red "Your Docusaurus site did not load properly" banner, with all /assets/* bundles returning 404.

Root cause

Since #269 the site is built for the identus.io apex custom domain (url: 'https://identus.io/', baseUrl: '/'). That requires a CNAME file on the published gh-pages branch.

release-gh-pages.yml deploys ./build to gh-pages with peaceiris/actions-gh-pages@v3 (no keep_files), which replaces the branch on every deploy. Because there was no CNAME in the Docusaurus build, each deploy deleted the hand-added gh-pages/CNAME, silently disabling the custom domain. GitHub then falls back to serving at the project path hyperledger-identus.github.io/docs/, but the build still references assets at root (baseUrl: '/') → /assets/* 404 → broken.

This produced ~9 manual Create CNAME / Update CNAME / Delete CNAME commits on gh-pages over the last month (by @ryjones, @elribonazo, @patextreme) — each fix only lasting until the next push to main.

Fix

Add static/CNAME containing identus.io. Docusaurus copies static/* into ./build, so the CNAME now ships with every deploy and peaceiris preserves it. The custom domain stays enabled permanently; no more manual re-adds.

Verification

  • static/CNAMEbuild/CNAME confirmed by Docusaurus static-asset pipeline (same mechanism already used for static/.nojekyll).
  • After enabling the custom domain in Pages settings, the site renders correctly at https://identus.io/ (home + /documentation/learn/): no banner, fully styled, hydrated. hyperledger-identus.github.io/docs/ 301-redirects to identus.io.

Alternatives considered

  • keep_files: true on the peaceiris action — works but can leave stale files; static/CNAME is the documented Docusaurus approach and is self-contained in the build.
  • Reverting to baseUrl: '/docs/' — would undo the intentional identus.io branding move in chore: update URL for docs #269.

@patextreme
patextreme requested a review from a team as a code owner July 30, 2026 17:51
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

Add static/CNAME (identus.io) so Docusaurus ships it in the build
output. release-gh-pages.yml publishes ./build to the gh-pages branch
via peaceiris/actions-gh-pages, so the build now carries CNAME and the
custom-domain configuration survives every deploy.

Without this, the hand-added CNAME on gh-pages is wiped on each deploy
(./build had no CNAME), which disables the identus.io custom domain.
The site then falls back to the project path
hyperledger-identus.github.io/docs/ while still built with baseUrl '/',
so /assets/* 404s and Docusaurus shows the "site did not load properly"
banner. This is the root cause behind the repeated manual
"Create CNAME" commits on gh-pages.

Signed-off-by: Pat Losoponkul <patextreme@hotmail.com>
@patextreme

Copy link
Copy Markdown
Contributor Author

🤖 Claude Code review — /review 273

Re-review after addressing point 1 (removed the stale # cname: doc.did.fmgp.app comment). Commit 86bc69a45.

Verdict: ✅ Approve. Correct, minimal, matches the documented root cause with real verification evidence.

Overview

release-gh-pages.yml deploys to gh-pages with peaceiris/actions-gh-pages@v3 and no keep_files, which replaces the entire branch on every push. Since the custom domain (identus.io, baseUrl: '/') from #269 was configured via a hand-added CNAME file directly on gh-pages, every deploy wiped it — silently falling back to project-path serving and breaking all /assets/* references built for the apex domain (the recurring "Docusaurus site did not load properly" banner).

The fix adds static/CNAME containing identus.io, so Docusaurus copies it into ./build on every build (same mechanism as the existing static/.nojekyll, confirmed present), making it survive every deploy. It also removes a stale commented-out cname: line referencing the legacy doc.did.fmgp.app domain.

Correctness — verified

  • docusaurus.config.ts confirms url: 'https://identus.io/' / baseUrl: '/' (matches the stated root cause).
  • static/CNAME = identus.io, correct format — the documented, standard Docusaurus pattern for persisting CNAME across GitHub Pages deploys.
  • Genuinely more robust than keep_files: true, which could accumulate stale build artifacts over time.

Scope & style

  • Minimal, single-purpose diff (2 files, +1/−1). No unrelated changes bundled in.
  • Consistent with the existing static/.nojekyll pattern.
  • Removing the dead cname: comment is good cleanup — it referenced an unrelated legacy domain and could confuse future readers.

Issues / risks

  • None significant — config/static-asset fix, no code paths, tests, or logic to break.
  • On a possible CI guard to catch a future manual deletion of static/CNAME: overkill for a two-line fix like this; acceptable risk.

Verification

No automated tests apply (static file + CI workflow config). PR description documents manual verification (site renders at https://identus.io/ post-deploy; old URL 301-redirects) — appropriate for this change type.


Generated by Claude Code v2.1.218 via /review 273, run on fix/durable-cname.

@sonarqubecloud

Copy link
Copy Markdown

@patextreme
patextreme merged commit 72462d2 into main Jul 31, 2026
9 checks passed
@patextreme
patextreme deleted the fix/durable-cname branch July 31, 2026 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants